#ifndef CAPPARAMBARWIDGET_H
#define CAPPARAMBARWIDGET_H

#include <QWidget>
#include <QVBoxLayout>
#include <QSpacerItem>
#include <qscrollarea.h>
#include "drawerbutton.h"
#include "unlockcmdwidget.h"
#include "axishandshakewidget.h"
#include "axisworkmodewidget.h"
#include "capcontrol.h"
#include "axispidwidget.h"
#include "axisthresholdwidget.h"
#include "groundtestwidget.h"

typedef struct _widgetAttr
{
    QWidget* pwidget;
    QString sName;
}st_widgetAttr;

class QCAPParamBarWidget : public QWidget
{
    Q_OBJECT
public:
    explicit QCAPParamBarWidget(QWidget *parent = nullptr);

    void InitUI();

signals:

public slots:
    void onAttrBtnClick(bool checked);

    void onSetAxisParam(int i32AxisNo,int nType,float lfkp,float lfki,float lfkd);
    void onSetUnlockCmd(int cmd,int value);
    void onSetAixsHandShakeParam(int i32AxisNo,int i32value,int datalen);
    void onSetPosAndSpeedParam(int i32AxisNo,int i32Cmdid,int i32Value,int datalen);//设置位置模式或速度模式参数

    void onGroundTest(int i32Axis,int workmode, int data0,int data1);

    void onRcvData(QVariant var);

private:
    QList<st_widgetAttr> m_st_widgetlist;
    QList<QDrawerButton*> m_st_buttonlist;

    QScrollArea* _pScrollAreaWidget;

    CCapControl* _pCapControl;

    QAxisPIDWidget* _pAxisparamwidget[2];
    QAxisWorkModeWidget* _pAxisControlWidget[2];
    QAxisThresholdWidget* _pAxisThresholdWidget[2];//门限值设置

    QGroundTestWidget* _pGroundTestWidget;



};

#endif // CAPPARAMBARWIDGET_H
